﻿using FM.Core;

namespace FM.Infrastructure
{
    public class UnitOfWork : IUnitOfWork
    {
        private FinanceContext dataContext;

        public UnitOfWork(FinanceContext dataContext)
        {
            this.dataContext = dataContext;
        }

        protected FinanceContext DataContext
        {
            get { return dataContext ?? (dataContext =new FinanceContext()); }
        }

        public void Commit()
        {
            DataContext.Commit();
        }
    }
}
